<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for DummyLink.class.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file DummyLink.class.php</h1>
<p>Documentation is available at <a href="../DomBase/_libsPub---BankLink---Banks---DummyLink.class.php.html">DummyLink.class.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-key">class&nbsp;</span><a href="../BankLink/DummyLink.html">DummyLink</a>&nbsp;<span class="src-key">extends&nbsp;</span><a href="../BankLink/BankLink.html">BankLink</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a3"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a4"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Private&nbsp;key.</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">String&nbsp;</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a8"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../BankLink/DummyLink.html#var$privateKey">$privateKey</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a9"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a10"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../BankLink/DummyLink.html#methodsendToBank">sendToBank</a><span class="src-sym">(&nbsp;</span><span class="src-var">$callBackId</span><span class="src-sym">,&nbsp;</span><span class="src-id">BankPayment&nbsp;</span><span class="src-var">$payment&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a11"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">usable&nbsp;</span>!==&nbsp;<span class="src-id">true&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a12"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">RuntimeException</span><span class="src-sym">(</span><span class="src-str">'Using&nbsp;dummy&nbsp;bank&nbsp;is&nbsp;not&nbsp;allowed!'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a13"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mac&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../BankLink/DummyLink.html#methodcalculateMac">calculateMac</a><span class="src-sym">(</span><span class="src-var">$callBackId</span><span class="src-sym">,&nbsp;</span><span class="src-var">$payment</span><span class="src-sym">-&gt;</span><span class="src-id">price</span><span class="src-sym">,&nbsp;</span><span class="src-var">$payment</span><span class="src-sym">-&gt;</span><span class="src-id">uid&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a15"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a16"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;send&nbsp;user&nbsp;to&nbsp;callback&nbsp;address</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'location:&nbsp;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">callbackUrl</span>.<span class="src-str">'&amp;logId='</span>.<span class="src-var">$callBackId</span>.<span class="src-str">'&amp;uid='</span>.<span class="src-var">$payment</span><span class="src-sym">-&gt;</span><span class="src-id">uid</span>.<span class="src-str">'&amp;price='</span>.<span class="src-var">$payment</span><span class="src-sym">-&gt;</span><span class="src-id">price</span>.<span class="src-str">'&amp;fromDummy=dummy&amp;mac='</span>.<span class="src-var">$mac</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a18"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*$html&nbsp;=&nbsp;'&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;name=&quot;logId&quot;&nbsp;value=&quot;'.$callBackId.'&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;name=&quot;uid&quot;&nbsp;value=&quot;'.$payment-&gt;uid.'&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;name=&quot;price&quot;&nbsp;value=&quot;'.$payment-&gt;price.'&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;name=&quot;fromDummy&quot;&nbsp;value=&quot;dummy&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;name=&quot;mac&quot;&nbsp;value=&quot;'.$mac.'&quot;&gt;';</span></div></li>
<li><div class="src-line"><a name="a24"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;self::getFormBase($this,&nbsp;$html);</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die();</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a28"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a29"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a30"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../BankLink/DummyLink.html#methodhandleCallback">handleCallback</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a31"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mac&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../BankLink/DummyLink.html#methodcalculateMac">calculateMac</a><span class="src-sym">(&nbsp;</span><span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-str">'logId'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-str">'price'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-str">'uid'</span><span class="src-sym">]&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a32"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$mac&nbsp;</span>!=&nbsp;<span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-str">'mac'</span><span class="src-sym">]&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'status'&nbsp;</span>=&gt;&nbsp;<span class="src-num">4</span><span class="src-sym">,&nbsp;</span><span class="src-str">'logId'&nbsp;</span>=&gt;&nbsp;<span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-str">'logId'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-str">'bankError'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-str">'bankErrorStr'</span>=&gt;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'status'&nbsp;</span>=&gt;&nbsp;<span class="src-num">1</span><span class="src-sym">,&nbsp;</span><span class="src-str">'logId'&nbsp;</span>=&gt;&nbsp;<span class="src-var">$_REQUEST</span><span class="src-sym">[</span><span class="src-str">'logId'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-str">'bankError'</span>=&gt;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-str">'bankErrorStr'</span>=&gt;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a36"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a39"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../BankLink/DummyLink.html#methodcalculateMac">calculateMac</a><span class="src-sym">(&nbsp;</span><span class="src-var">$callBackId</span><span class="src-sym">,&nbsp;</span><span class="src-var">$price</span><span class="src-sym">,&nbsp;</span><span class="src-var">$uid&nbsp;</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><a href="http://www.php.net/sha1">sha1</a><span class="src-sym">(</span><a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../BankLink/DummyLink.html#var$privateKey">privateKey</a>.<span class="src-str">'|'</span>.<span class="src-var">$callbackId</span>.<span class="src-str">'|'</span>.<span class="src-var">$price</span>.<span class="src-str">'|'</span>.<span class="src-var">$uid</span>.<span class="src-str">'|dummy'</span><span class="src-sym">)))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a43"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-php">?&gt;</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 24 Sep 2010 21:14:31 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</body>
</html>